/* main.c */

#include <stdio.h>

#include "board.h"

#include "pff.h"
#include "tjpgd.h"
#include "ili9486.h"

extern FRESULT fs_load_jpg(char *fullpath, uint8_t scale);

FATFS fatfs;
FRESULT err;

int main(void)
{
    uint8_t ch;

    board_init();

    /* lcd. */
    ili9486_init_hardware();
    ili9486_init();

    ili9486_clear_screen(LCD_COLOR_RED);

    /* fatfs. */
    err = pf_mount(&fatfs);
    printf("pf_mount: %d\r\n", err);

    while (1)
    {
        //ch = getchar();
        //putchar(ch);

        err = fs_load_jpg("0_0.jpg", 0u);
        printf("fs_load_jpg: %d\r\n", err);

        err = fs_load_jpg("0_1.jpg", 0u);
        printf("fs_load_jpg: %d\r\n", err);

        err = fs_load_jpg("0_2.jpg", 0u);
        printf("fs_load_jpg: %d\r\n", err);

        err = fs_load_jpg("1_1.jpg", 1u);
        printf("fs_load_jpg: %d\r\n", err);

        err = fs_load_jpg("1_2.jpg", 1u);
        printf("fs_load_jpg: %d\r\n", err);

        err = fs_load_jpg("1_0.jpg", 1u);
        printf("fs_load_jpg: %d\r\n", err);
    }
}
/* EOF. */

